package imnu.th01;

/**
 * @author: lys
 * @类名: Thread01
 * @Title:
 * @date: 2020/7/21
 **/
public class Thread01 extends Thread {
    private Thread02 thread02;

    public Thread01() {
    }

    public Thread01(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i=0;i<=10;i++){
            System.out.println(i+"黑龙");
            try {
                if (i==5){
                    thread02.join();
                }
                Thread.sleep(300);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public Thread02 getThread02() {
        return thread02;
    }

    public void setThread02(Thread02 thread02) {
        this.thread02 = thread02;
    }
}
